Optimal. Leaf size=121 \[ \frac{c^3 (A+4 i B) \tan (e+f x)}{a f}-\frac{4 c^3 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac{4 c^3 (-2 B+i A) \log (\cos (e+f x))}{a f}-\frac{4 c^3 x (A+2 i B)}{a}+\frac{B c^3 \tan ^2(e+f x)}{2 a f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.18277, antiderivative size = 121, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.049, Rules used = {3588, 77} \[ \frac{c^3 (A+4 i B) \tan (e+f x)}{a f}-\frac{4 c^3 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac{4 c^3 (-2 B+i A) \log (\cos (e+f x))}{a f}-\frac{4 c^3 x (A+2 i B)}{a}+\frac{B c^3 \tan ^2(e+f x)}{2 a f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3588
Rule 77
Rubi steps
\begin{align*} \int \frac{(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{(A+B x) (c-i c x)^2}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left (\frac{(A+4 i B) c^2}{a^2}+\frac{B c^2 x}{a^2}-\frac{4 (A+i B) c^2}{a^2 (-i+x)^2}+\frac{4 i (A+2 i B) c^2}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{4 (A+2 i B) c^3 x}{a}-\frac{4 (i A-2 B) c^3 \log (\cos (e+f x))}{a f}-\frac{4 (A+i B) c^3}{a f (i-\tan (e+f x))}+\frac{(A+4 i B) c^3 \tan (e+f x)}{a f}+\frac{B c^3 \tan ^2(e+f x)}{2 a f}\\ \end{align*}
Mathematica [A] time = 5.75274, size = 212, normalized size = 1.75 \[ \frac{c^3 (\cos (f x)+i \sin (f x)) (A+B \tan (e+f x)) \left (4 (A+i B) (\sin (e)+i \cos (e)) \cos (2 f x)+4 (A+i B) (\cos (e)-i \sin (e)) \sin (2 f x)+4 (2 B-i A) (\cos (e)+i \sin (e)) \log \left (\cos ^2(e+f x)\right )-8 (A+2 i B) (\cos (e)+i \sin (e)) \tan ^{-1}(\tan (f x))+2 (A+4 i B) (1+i \tan (e)) \sin (f x) \sec (e+f x)+B (\cos (e)+i \sin (e)) \sec ^2(e+f x)\right )}{2 f (a+i a \tan (e+f x)) (A \cos (e+f x)+B \sin (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.042, size = 150, normalized size = 1.2 \begin{align*}{\frac{A{c}^{3}\tan \left ( fx+e \right ) }{af}}+{\frac{4\,iB{c}^{3}\tan \left ( fx+e \right ) }{af}}+{\frac{B{c}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,af}}+{\frac{4\,iB{c}^{3}}{af \left ( \tan \left ( fx+e \right ) -i \right ) }}+4\,{\frac{A{c}^{3}}{af \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{4\,i{c}^{3}A\ln \left ( \tan \left ( fx+e \right ) -i \right ) }{af}}-8\,{\frac{B{c}^{3}\ln \left ( \tan \left ( fx+e \right ) -i \right ) }{af}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.41752, size = 587, normalized size = 4.85 \begin{align*} -\frac{8 \,{\left (A + 2 i \, B\right )} c^{3} f x e^{\left (6 i \, f x + 6 i \, e\right )} -{\left (2 i \, A - 2 \, B\right )} c^{3} +{\left (16 \,{\left (A + 2 i \, B\right )} c^{3} f x -{\left (4 i \, A - 8 \, B\right )} c^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (8 \,{\left (A + 2 i \, B\right )} c^{3} f x -{\left (6 i \, A - 12 \, B\right )} c^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} -{\left ({\left (-4 i \, A + 8 \, B\right )} c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} +{\left (-8 i \, A + 16 \, B\right )} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (-4 i \, A + 8 \, B\right )} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{a f e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 6.18212, size = 248, normalized size = 2.05 \begin{align*} \frac{\frac{\left (2 i A c^{3} - 8 B c^{3}\right ) e^{- 4 i e}}{a f} + \frac{\left (2 i A c^{3} - 6 B c^{3}\right ) e^{- 2 i e} e^{2 i f x}}{a f}}{e^{4 i f x} + 2 e^{- 2 i e} e^{2 i f x} + e^{- 4 i e}} + \frac{4 c^{3} \left (- i A + 2 B\right ) \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} - \frac{\left (\begin{cases} 8 A c^{3} x e^{2 i e} - \frac{2 i A c^{3} e^{- 2 i f x}}{f} + 16 i B c^{3} x e^{2 i e} + \frac{2 B c^{3} e^{- 2 i f x}}{f} & \text{for}\: f \neq 0 \\x \left (8 A c^{3} e^{2 i e} - 4 A c^{3} + 16 i B c^{3} e^{2 i e} - 4 i B c^{3}\right ) & \text{otherwise} \end{cases}\right ) e^{- 2 i e}}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.52244, size = 437, normalized size = 3.61 \begin{align*} -\frac{2 \,{\left (\frac{4 \,{\left (-i \, A c^{3} + 2 \, B c^{3}\right )} \log \left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - i\right )}{a} - \frac{2 \,{\left (-i \, A c^{3} + 2 \, B c^{3}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{a} - \frac{{\left (-2 i \, A c^{3} + 4 \, B c^{3}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{a} + \frac{5 \, A c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 8 i \, B c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} - 2 i \, A c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} + 7 \, B c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 10 \, A c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 14 i \, B c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 2 i \, A c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 7 \, B c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 5 \, A c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 8 i \, B c^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - i \, \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}^{2} a}\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]